<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/12/5/005
 * Time: 11:57
 */

namespace app\api\model;


class Banner extends BaseModel {
    protected $hidden = ['create_time', 'update_time', 'type', 'sort', 'status', 'delete'];

    public function getImageAttr($value) {
        return get_img_url($value);
    }

    public static function getBannerList() {
        $list = self::where('type', '=', 1)
            ->where('status', '=', 1)
            ->where('delete', '=', 0)
            ->order('sort desc')
            ->select();
        return $list;
    }
}